home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 September / CHIP Eylül 1998.iso / Slackwar / docs / Benchmarking-HOWTO < prev    next >
Text File  |  1997-08-17  |  42KB  |  1,051 lines

  1.   Linux Benchmarking HOWTO
  2.   by AndrΘ D. Balsa, andrewbalsa@usa.net  <mailto:andrewbalsa@usa.net>
  3.   v0.12, 15 August 1997
  4.  
  5.   The Linux Benchmarking HOWTO discusses some issues associated with the
  6.   benchmarking of Linux systems and presents a basic benchmarking
  7.   toolkit, as well as an associated form, which enable one to produce
  8.   significant benchmarking information in a couple of hours. Perhaps it
  9.   will also help diminish the amount of useless articles in
  10.   comp.os.linux.hardware...
  11.  
  12.   1.  Introduction
  13.  
  14.   "What we cannot speak about we must pass over in silence."
  15.  
  16.        Ludwig Wittgenstein (1889-1951), Austrian philosopher
  17.  
  18.   Benchmarking means measuring the speed with which a computer system
  19.   will execute a computing task, in a way that will allow comparison
  20.   between different hard/software combinations. It does not involve
  21.   user-friendliness, aesthetic or ergonomic considerations or any other
  22.   subjective judgment.
  23.  
  24.   Benchmarking is a tedious, repetitive task, and takes attention to
  25.   details. Very often the results are not what one would expect, and
  26.   subject to interpretation (which actually may be the most important
  27.   part of a benchmarking procedure).
  28.  
  29.   Finally, benchmarking deals with facts and figures, not opinion or
  30.   approximation.
  31.  
  32.   1.1.  Why is benchmarking so important ?
  33.  
  34.   Apart from the reasons pointed out in the BogoMips Mini-HOWTO (section
  35.   7, paragraph 2), one occasionally is confronted with a limited budget
  36.   and/or minimum performance requirements while putting together a Linux
  37.   box. In other words, when confronted with the following questions:
  38.  
  39.   ╖  How do I maximize performance within a given budget ?
  40.  
  41.   ╖  How do I minimize costs for a required minimum performance level ?
  42.  
  43.   ╖  How do I obtain the best performance/cost ratio (within a given
  44.      budget or given performance requirements)?
  45.  
  46.   one will have to examine, compare and/or produce benchmarks.
  47.   Minimizing costs with no performance requirements usually involves
  48.   putting together a machine with leftover parts (that old 386SX-16 box
  49.   lying around in the garage will do fine) and does not require
  50.   benchmarks, and maximizing performance with no cost ceiling is not a
  51.   realistic situation (unless one is willing to put a Cray box in
  52.   his/her living room - the leather-covered power supplies around it
  53.   look nice, don't they ?).
  54.  
  55.   Benchmarking per se is senseless, a waste of time and money; it is
  56.   only meaningful as part of a decision process, i.e. if one has to make
  57.   a choice between two or more alternatives.
  58.  
  59.   Usually another parameter in the decision process is cost, but it
  60.   could be availability, service, reliability, strategic considerations
  61.   or any other rational, measurable characteristic of a computer system.
  62.   When comparing the performance of different Linux kernel versions, for
  63.   example, stability is almost always more important than speed.
  64.   1.2.  Invalid benchmarking considerations
  65.  
  66.   Very often read in newsgroups and mailing lists, unfortunately:
  67.  
  68.   1. Reputation of manufacturer (unmeasurable and meaningless).
  69.  
  70.   2. Market share of manufacturer (meaningless and irrelevant).
  71.  
  72.   3. Irrational parameters (for example, superstition or prejudice:
  73.      would you buy a processor labeled 131313ZAP and painted pink ?)
  74.  
  75.   4. Perceived value (meaningless, unmeasurable and irrational).
  76.  
  77.   5. Amount of marketing hype: this one is the worst, I guess. I
  78.      personally am fed up with the "XXX inside" or "kkkkkws compatible"
  79.      logos (now the "aaaaaPowered" has joined the band - what next ?).
  80.      IMHO, the billions of dollars spent on such campaigns would be
  81.      better used by research teams on the design of new, faster,
  82.      (cheaper :-) bug-free processors. No amount of marketing hype will
  83.      remove a floating-point bug in the FPU of the brand-new processor
  84.      you just plugged in your motherboard, but an exchange against a
  85.      redesigned processor will.
  86.  
  87.   6. "You get what you pay for" opinions are just that: opinions. Give
  88.      me the facts, please.
  89.  
  90.   2.  Benchmarking procedures and interpretation of results
  91.  
  92.   A few semi-obvious recommendations:
  93.  
  94.   1. First and foremost, identify your benchmarking goals. What is it
  95.      you are exactly trying to benchmark ? In what way will the
  96.      benchmarking process help later in your decision making ? How much
  97.      time and resources are you willing to put into your benchmarking
  98.      effort ?
  99.  
  100.   2. Use standard tools. Use a current, stable kernel version, standard,
  101.      current gcc and libc and a standard benchmark. In short, use the
  102.      LBT (see below).
  103.  
  104.   3. Give a complete description of your setup (see the LBT report form
  105.      below).
  106.  
  107.   4. Try to isolate a single variable. Comparative benchmarking is more
  108.      informative than "absolute" benchmarking. I cannot stress this
  109.      enough.
  110.  
  111.   5. Verify your results. Run your benchmarks a few times and verify the
  112.      variations in your results, if any. Unexplained variations will
  113.      invalidate your results.
  114.  
  115.   6. If you think your benchmarking effort produced meaningful
  116.      information, share it with the Linux community in a precise and
  117.      concise way.
  118.  
  119.   7. Please forget about BogoMips. I promise myself I shall someday
  120.      implement a very fast ASIC with the BogoMips loop wired in. Then we
  121.      shall see what we shall see !
  122.  
  123.   2.1.  Understanding benchmarking choices
  124.  
  125.   2.1.1.  Synthetic vs. applications benchmarks
  126.  
  127.   Before spending any amount of time on benchmarking chores, a basic
  128.   choice must be made between "synthetic" benchmarks and "applications"
  129.   benchmarks.
  130.  
  131.   Synthetic benchmarks are specifically designed to measure the
  132.   performance of individual components of a computer system, usually by
  133.   exercising the chosen component to its maximum capacity. An example of
  134.   a well-known synthetic benchmark is the Whetstone suite, originally
  135.   programmed in 1972 by Harold Curnow in FORTRAN (or was that ALGOL ?)
  136.   and still in widespread use nowadays. The Whestone suite will measure
  137.   the floating-point performance of a CPU.
  138.  
  139.   The main critic that can be made to synthetic benchmarks is that they
  140.   do not represent a computer system's performance in real-life
  141.   situations. Take for example the Whetstone suite: the main loop is
  142.   very short and will easily fit in the primary cache of a CPU, keeping
  143.   the FPU pipeline constantly filled and so exercising the FPU to its
  144.   maximum speed. We cannot really criticize the Whetstone suite if we
  145.   remember it was programmed 25 years ago (its design dates even earlier
  146.   than that !), but we must make sure we interpret its results with
  147.   care, when it comes to benchmarking modern microprocessors.
  148.  
  149.   Another very important point to note about synthetic benchmarks is
  150.   that, ideally, they should tell us something about a specific aspect
  151.   of the system being tested, independently of all other aspects: a
  152.   synthetic benchmark for Ethernet card I/O throughput should result in
  153.   the same or similar figures whether it is run on a 386SX-16 with 4
  154.   MBytes of RAM or a Pentium 200 MMX with 64 MBytes of RAM. Otherwise,
  155.   the test will be measuring the overall performance of the
  156.   CPU/Motherboard/Bus/Ethernet card/Memory subsystem/DMA combination:
  157.   not very useful since the variation in CPU will cause a greater impact
  158.   than the change in Ethernet network card (this of course assumes we
  159.   are using the same kernel/driver combination, which could cause an
  160.   even greater variation)!
  161.  
  162.   Finally, a very common mistake is to average various synthetic
  163.   benchmarks and claim that such an average is a good representation of
  164.   real-life performance for any given system.
  165.  
  166.   Here is a comment on FPU benchmarks quoted with permission from the
  167.   Cyrix Corp. Web site:
  168.  
  169.        "A Floating Point Unit (FPU) accelerates software designed
  170.        to use floating point mathematics : typically CAD programs,
  171.        spreadsheets, 3D games and design applications. However,
  172.        today's most popular PC applications make use of both float¡
  173.        ing point and integer instructions. As a result, Cyrix chose
  174.        to emphasize "parallelism" in the design of the 6x86 proces¡
  175.        sor to speed up software that intermixes these two instruc¡
  176.        tion types.
  177.  
  178.        The x86 floating point exception model allows integer
  179.        instructions to issue and complete while a floating point
  180.        instruction is executing. In contrast, a second floating
  181.        point instruction cannot begin execution while a previous
  182.        floating point instruction is executing. To remove the per¡
  183.        formance limitation created by the floating point exception
  184.        model, the 6x86 can speculatively issue up to four floating
  185.        point instructions to the on-chip FPU while continuing to
  186.        issue and execute integer instructions. As an example, in a
  187.        code sequence of two floating point instructions (FLTs)
  188.   followed by six integer instructions (INTs) followed by two
  189.   FLTs, the 6x86 processor can issue all ten instructions to
  190.   the appropriate execution units prior to completion of the
  191.   first FLT. If none of the instructions fault (the typical
  192.   case), execution continues with both the integer and float¡
  193.   ing point units completing instructions in parallel. If one
  194.   of the FLTs faults (the atypical case), the speculative exe¡
  195.   cution capability of the 6x86 allows the processor state to
  196.   be restored in such a way that it is compatible with the x86
  197.   floating point exception model.
  198.  
  199.        Examination of benchmark tests reveals that synthetic float¡
  200.        ing point benchmarks use a pure floating point-only code
  201.        stream not found in real-world applications. This type of
  202.        benchmark does not take advantage of the speculative execu¡
  203.        tion capability of the 6x86 processor. Cyrix believes that
  204.        non-synthetic benchmarks based on real-world applications
  205.        better reflect the actual performance users will achieve.
  206.        Real-world applications contain intermixed integer and
  207.        floating point instructions and therefore benefit from the
  208.        6x86 speculative execution capability."
  209.  
  210.   So, the recent trend in benchmarking is to choose common applications
  211.   and use them to test the performance of complete computer systems. For
  212.   example, SPEC, the non-profit corporation that designed the well-known
  213.   SPECINT and SPECFP synthetic benchmark suites, has launched a project
  214.   for a new applications benchmark suite. But then again, it is very
  215.   unlikely that such commercial benchmarks will ever include any Linux
  216.   code.
  217.  
  218.   Summarizing, synthetic benchmarks are valid as long as you understand
  219.   their purposes and limitations. Applications benchmarks will better
  220.   reflect a computer system's performance, but none are available for
  221.   Linux.
  222.  
  223.   2.1.2.  High-level vs. low-level benchmarks
  224.  
  225.   Low-level benchmarks will directly measure the performance of the
  226.   hardware: CPU clock, DRAM and cache SRAM cycle times, hard disk
  227.   average access time, latency, track-to-track stepping time, etc...
  228.   This can be useful in case you bought a system and are wondering what
  229.   components it was built with, but a better way to check these figures
  230.   would be to open the case, list whatever part numbers you can find and
  231.   somehow obtain the data sheet for each part (usually on the Web).
  232.  
  233.   Another use for low-level benchmarks is to check that a kernel driver
  234.   was correctly configured for a specific piece of hardware: if you have
  235.   the data sheet for the component, you can compare the results of the
  236.   low-level benchmarks to the theoretical, printed specs.
  237.  
  238.   High-level benchmarks are more concerned with the performance of the
  239.   hardware/driver/OS combination for a specific aspect of a
  240.   microcomputer system, for example file I/O performance, or even for a
  241.   specific hardware/driver/OS/application performance, e.g. an Apache
  242.   benchmark on different microcomputer systems.
  243.  
  244.   Of course, all low-level benchmarks are synthetic. High-level
  245.   benchmarks may be synthetic or applications benchmarks.
  246.  
  247.   2.2.  Standard benchmarks available for Linux
  248.  
  249.   IMHO a simple test that anyone can do while upgrading any component in
  250.   his/her Linux box is to launch a kernel compile before and after the
  251.   hard/software upgrade and compare compilation times. If all other
  252.   conditions are kept equal then the test is valid as a measure of
  253.   compilation performance and one can be confident to say that:
  254.  
  255.        "Changing A to B led to an improvement of x % in the compile
  256.        time of the Linux kernel under such and such conditions".
  257.  
  258.   No more, no less !
  259.  
  260.   Since kernel compilation is a very usual task under Linux, and since
  261.   it exercises most functions that get exercised by normal benchmarks
  262.   (except floating-point performance), it constitutes a rather good
  263.   individual test. In most cases, however, results from such a test
  264.   cannot be reproduced by other Linux users because of variations in
  265.   hard/software configurations and so this kind of test cannot be used
  266.   as a "yardstick" to compare dissimilar systems (unless we all agree on
  267.   a standard kernel to compile - see below).
  268.  
  269.   Unfortunately, there are no Linux-specific benchmarking tools, except
  270.   perhaps the Byte Linux Benchmarks which are a slightly modified
  271.   version of the Byte Unix Benchmarks dating back from May 1991 (Linux
  272.   mods by Jon Tombs, original authors Ben Smith, Rick Grehan and Tom
  273.   Yager).
  274.  
  275.   There is a central Web site for the Byte Linux Benchmarks.
  276.  
  277.   An improved, updated version of the Byte Unix Benchmarks was put
  278.   together by David C. Niemi. It is called UnixBench 4.01 to avoid
  279.   confusion with earlier versions. Here is what David wrote about his
  280.   mods:
  281.  
  282.        "The original and slightly modified BYTE Unix benchmarks are
  283.        broken in quite a number of ways which make them an unusu¡
  284.        ally unreliable indicator of system performance. I inten¡
  285.        tionally made my "index" values look a lot different to
  286.        avoid confusion with the old benchmarks."
  287.  
  288.   David has setup a majordomo mailing list for discussion of
  289.   benchmarking on Linux and competing OSs. Join with "subscribe bench"
  290.   sent in the body of a message to majordomo@wauug.erols.com
  291.   <mailto:majordomo@wauug.erols.com>. The Washington Area Unix User
  292.   Group is also in the process of setting up a  Web site for Linux
  293.   benchmarks.
  294.  
  295.   Also recently, Uwe F. Mayer, mayer@math.vanderbilt.edu
  296.   <mailto:mayer@math.vanderbilt.edu>ported the BYTE Bytemark suite to
  297.   Linux. This is a modern suite carefully put together by Rick Grehan at
  298.   BYTE Magazine to test the CPU, FPU and memory system performance of
  299.   modern microcomputer systems (these are strictly processor-performance
  300.   oriented benchmarks, no I/O or system performance is taken into
  301.   account).
  302.  
  303.   Uwe has also put together a Web site with a database of test results
  304.   for his version of the Linux BYTEmark benchmarks.
  305.  
  306.   While searching for synthetic benchmarks for Linux, you will notice
  307.   that sunsite.unc.edu carries few benchmarking tools. To test the
  308.   relative speed of X servers and graphics cards, the xbench-0.2 suite
  309.   by Claus Gittinger is available from sunsite.unc.edu, ftp.x.org and
  310.   other sites. Xfree86.org refuses (wisely) to carry or recommend any
  311.   benchmarks.
  312.  
  313.   The XFree86-benchmarks Survey is a Web site with a database of x-bench
  314.   results.
  315.  
  316.   For pure disk I/O throughput, the hdparm program (included with most
  317.   distributions, otherwise available from sunsite.unc.edu) will measure
  318.   transfer rates if called with the -t and -T switches.
  319.  
  320.   There are many other tools freely available on the Internet to test
  321.   various performance aspects of your Linux box.
  322.  
  323.   2.3.  Links and references
  324.  
  325.   The comp.benchmarks.faq by Dave Sill is the standard reference for
  326.   benchmarking. It is not Linux specific, but recommended reading for
  327.   anybody serious about benchmarking. It is available from a number of
  328.   FTP and web sites and lists 56 different benchmarks, with links to FTP
  329.   or Web sites that carry them. Some of the benchmarks listed are
  330.   commercial (SPEC for example), though.
  331.  
  332.   I will not go through each one of the benchmarks mentionned in the
  333.   comp.benchmarks.faq, but there is at least one low-level suite which I
  334.   would like to comment on: the  lmbench suite, by Larry McVoy. Quoting
  335.   David C. Niemi:
  336.  
  337.        "Linus and David Miller use this a lot because it does some
  338.        useful low-level measurements and can also measure network
  339.        throughput and latency if you have 2 boxes to test with. But
  340.        it does not attempt to come up with anything like an overall
  341.        "figure of merit"..."
  342.  
  343.   A rather complete FTP site for freely available benchmarks was put
  344.   together by Alfred Aburto. The Whetstone suite used in the LBT can be
  345.   found at this site.
  346.  
  347.   There is a multipart FAQ by Eugene Miya that gets posted regularly to
  348.   comp.benchmarks; it is an excellent reference.
  349.  
  350.   3.  The Linux Benchmarking Toolkit (LBT)
  351.  
  352.   I will propose a basic benchmarking toolkit for Linux. This is a
  353.   preliminary version of a comprehensive Linux Benchmarking Toolkit, to
  354.   be expanded and improved. Take it for what it's worth, i.e. as a
  355.   proposal. If you don't think it is a valid test suite, feel free to
  356.   email me your critics and I will be glad to make the changes and
  357.   improve it if I can. Before getting into an argument, however, read
  358.   this HOWTO and the mentionned references: informed criticism is
  359.   welcomed, empty criticism is not.
  360.  
  361.   3.1.  Rationale
  362.  
  363.   This is just common sense:
  364.  
  365.   1. It should not take a whole day to run. When it comes to comparative
  366.      benchmarking (various runs), nobody wants to spend days trying to
  367.      figure out the fastest setup for a given system. Ideally, the
  368.      entire benchmark set should take about 15 minutes to complete on an
  369.      average machine.
  370.  
  371.   2. All source code for the software used must be freely available on
  372.      the Net, for obvious reasons.
  373.  
  374.   3. Benchmarks should provide simple figures reflecting the measured
  375.      performance.
  376.  
  377.   4. There should be a mix of synthetic benchmarks and application
  378.      benchmarks (with separate results, of course).
  379.  
  380.   5. Each synthetic benchmarks should exercise a particular subsystem to
  381.      its maximum capacity.
  382.  
  383.   6. Results of synthetic benchmarks should not be averaged into a
  384.      single figure of merit (that defeats the whole idea behind
  385.      synthetic benchmarks, with considerable loss of information).
  386.  
  387.   7. Applications benchmarks should consist of commonly executed tasks
  388.      on Linux systems.
  389.  
  390.   3.2.  Benchmark selection
  391.  
  392.   I have selected five different benchmark suites, trying as much as
  393.   possible to avoid overlap in the tests:
  394.  
  395.   1. Kernel 2.0.0 (default configuration) compilation using gcc.
  396.  
  397.   2. Whetstone version 10/03/97 (latest version by Roy Longbottom).
  398.  
  399.   3. xbench-0.2 (with fast execution parameters).
  400.  
  401.   4. UnixBench benchmarks version 4.01 (partial results).
  402.  
  403.   5. BYTE Magazine's BYTEmark benchmarks beta release 2 (partial
  404.      results).
  405.  
  406.   For tests 4 and 5, "(partial results)" means that not all results
  407.   produced by these benchmarks are considered.
  408.  
  409.   3.3.  Test duration
  410.  
  411.   1. Kernel 2.0.0 compilation: 5 - 30 minutes, depending on the real
  412.      performance of your system.
  413.  
  414.   2. Whetstone: 100 seconds.
  415.  
  416.   3. Xbench-0.2: < 1 hour.
  417.  
  418.   4. UnixBench benchmarks version 4.01: approx. 15 minutes.
  419.  
  420.   5. BYTE Magazine's BYTEmark benchmarks: approx. 10 minutes.
  421.  
  422.   3.4.  Comments
  423.  
  424.   3.4.1.  Kernel 2.0.0 compilation:
  425.  
  426.   ╖  What: it is the only application benchmark in the LBT.
  427.  
  428.   ╖  The code is widely available (i.e. I finally found some use for my
  429.      old Linux CD-ROMs).
  430.  
  431.   ╖  Most linuxers recompile the kernel quite often, so it is a
  432.      significant measure of overall performance.
  433.   ╖  The kernel is large and gcc uses a large chunk of memory:
  434.      attenuates L2 cache size bias with small tests.
  435.  
  436.   ╖  It does frequent I/O to disk.
  437.  
  438.   ╖  Test procedure: get a pristine 2.0.0 source, compile with default
  439.      options (make config, press Enter repeatedly). The reported time
  440.      should be the time spent on compilation i.e. after you type make
  441.      zImage, not including make dep, make clean. Note that the default
  442.      target architecture for the kernel is the i386, so if compiled on
  443.      another architecture, gcc too should be set to cross-compile, with
  444.      i386 as the target architecture.
  445.  
  446.   ╖  Results: compilation time in minutes and seconds (please don't
  447.      report fractions of seconds).
  448.  
  449.   3.4.2.  Whetstone:
  450.  
  451.   ╖  What: measures pure floating point performance with a short, tight
  452.      loop. The source (in C) is quite readable and it is very easy to
  453.      see which floating-point operations are involved.
  454.  
  455.   ╖  Shortest test in the LBT :-).
  456.  
  457.   ╖  It's an "Old Classic" test: comparable figures are available, its
  458.      flaws and shortcomings are well known.
  459.  
  460.   ╖  Test procedure: the newest C source should be obtained from
  461.      Aburto's site. Compile and run in double precision mode. Specify
  462.      gcc and -O2 as precompiler and precompiler options, and define
  463.      POSIX 1 to specify machine type.
  464.  
  465.   ╖  Results: a floating-point performance figure in MWIPS.
  466.  
  467.   3.4.3.  Xbench-0.2:
  468.  
  469.   ╖  What: measures X server performance.
  470.  
  471.   ╖  The xStones measure provided by xbench is a weighted average of
  472.      several tests indexed to an old Sun station with a single-bit-depth
  473.      display. Hmmm... it is questionable as a test of modern X servers,
  474.      but it's still the best tool I have found.
  475.  
  476.   ╖  Test procedure: compile with -O2. We specify a few options for a
  477.      shorter run: ./xbench -timegoal 3 >
  478.      results/name_of_your_linux_box.out. To get the xStones rating, we
  479.      must run an awk script; the simplest way is to type make
  480.      summary.ms. Check the summary.ms file: the xStone rating for your
  481.      system is in the last column of the line with your machine name
  482.      specified during the test.
  483.  
  484.   ╖  Results: an X performance figure in xStones.
  485.  
  486.   ╖  Note: this test, as it stands, is outdated. It should be re-coded.
  487.  
  488.   3.4.4.  UnixBench version 4.01:
  489.  
  490.   ╖  What: measures overall Unix performance. This test will exercice
  491.      the file I/O and kernel multitasking performance.
  492.  
  493.   ╖  I have discarded all arithmetic test results, keeping only the
  494.      system-related test results.
  495.  
  496.   ╖  Test procedure: make with -O2. Execute with ./Run -1 (run each test
  497.      once). You will find the results in the ./results/report file.
  498.      Calculate the geometric mean of the EXECL THROUGHPUT, FILECOPY 1,
  499.      2, 3, PIPE THROUGHPUT, PIPE-BASED CONTEXT SWITCHING, PROCESS
  500.      CREATION, SHELL SCRIPTS and SYSTEM CALL OVERHEAD indexes.
  501.  
  502.   ╖  Results: a system index.
  503.  
  504.   3.4.5.  BYTE Magazine's BYTEmark benchmarks:
  505.  
  506.   ╖  What: provides a good measure of CPU performance. Here is an
  507.      excerpt from the documentation: "These benchmarks are meant to
  508.      expose the theoretical upper limit of the CPU, FPU, and memory
  509.      architecture of a system. They cannot measure video, disk, or
  510.      network throughput (those are the domains of a different set of
  511.      benchmarks). You should, therefore, use the results of these tests
  512.      as part, not all, of any evaluation of a system."
  513.  
  514.   ╖  I have discarded the FPU test results since the Whetstone test is
  515.      just as representative of FPU performance.
  516.  
  517.   ╖  I have split the integer tests in two groups: those more
  518.      representative of memory-cache-CPU performance and the CPU integer
  519.      tests.
  520.  
  521.   ╖  Test procedure: make with -O2. Run the test with ./nbench >
  522.      myresults.dat or similar. Then, from myresults.dat, calculate
  523.      geometric mean of STRING SORT, ASSIGNMENT and BITFIELD test
  524.      indexes; this is the memory index; calculate the geometric mean of
  525.      NUMERIC SORT, IDEA, HUFFMAN and FP EMULATION test indexes; this is
  526.      the integer index.
  527.  
  528.   ╖  Results: a memory index and an integer index calculated as
  529.      explained above.
  530.  
  531.   3.5.  Possible improvements
  532.  
  533.   The ideal benchmark suite would run in a few minutes, with synthetic
  534.   benchmarks testing every subsystem separately and applications
  535.   benchmarks providing results for different applications. It would also
  536.   automatically generate a complete report and eventually email the
  537.   report to a central database on the Web.
  538.  
  539.   We are not really interested in portability here, but it should at
  540.   least run on all recent (> 2.0.0) versions and flavours (i386, Alpha,
  541.   Sparc...) of Linux.
  542.  
  543.   If anybody has any idea about benchmarking network performance in a
  544.   simple, easy and reliable way, with a short (less than 30 minutes to
  545.   setup and run) test, please contact me.
  546.  
  547.   3.6.  LBT Report Form
  548.  
  549.   Besides the tests, the benchmarking procedure would not be complete
  550.   without a form describing the setup, so here it is (following the
  551.   guidelines from comp.benchmarks.faq):
  552.  
  553.   ______________________________________________________________________
  554.   LINUX BENCHMARKING TOOLKIT REPORT FORM
  555.   ______________________________________________________________________
  556.  
  557.   ______________________________________________________________________
  558.   CPU
  559.   ==
  560.   Vendor:
  561.   Model:
  562.   Core clock:
  563.   Motherboard vendor:
  564.   Mbd. model:
  565.   Mbd. chipset:
  566.   Bus type:
  567.   Bus clock:
  568.   Cache total:
  569.   Cache type/speed:
  570.   SMP (number of processors):
  571.   ______________________________________________________________________
  572.  
  573.   ______________________________________________________________________
  574.   RAM
  575.   ====
  576.   Total:
  577.   Type:
  578.   Speed:
  579.   ______________________________________________________________________
  580.  
  581.   ______________________________________________________________________
  582.   Disk
  583.   ====
  584.   Vendor:
  585.   Model:
  586.   Size:
  587.   Interface:
  588.   Driver/Settings:
  589.   ______________________________________________________________________
  590.  
  591.   ______________________________________________________________________
  592.   Video board
  593.   ===========
  594.   Vendor:
  595.   Model:
  596.   Bus:
  597.   Video RAM type:
  598.   Video RAM total:
  599.   X server vendor:
  600.   X server version:
  601.   X server chipset choice:
  602.   Resolution/vert. refresh rate:
  603.   Color depth:
  604.   ______________________________________________________________________
  605.  
  606.   ______________________________________________________________________
  607.   Kernel
  608.   =====
  609.   Version:
  610.   Swap size:
  611.   ______________________________________________________________________
  612.  
  613.   ______________________________________________________________________
  614.   gcc
  615.   ===
  616.   Version:
  617.   Options:
  618.   libc version:
  619.   ______________________________________________________________________
  620.  
  621.   ______________________________________________________________________
  622.   Test notes
  623.   ==========
  624.   ______________________________________________________________________
  625.  
  626.   ______________________________________________________________________
  627.   RESULTS
  628.   ========
  629.   Linux kernel 2.0.0 Compilation Time: (minutes and seconds)
  630.   Whetstones: results are in MWIPS.
  631.   Xbench: results are in xstones.
  632.   Unixbench Benchmarks 4.01 system INDEX:
  633.   BYTEmark integer INDEX:
  634.   BYTEmark memory INDEX:
  635.   ______________________________________________________________________
  636.  
  637.   ______________________________________________________________________
  638.   Comments*
  639.   =========
  640.   * This field is included for possible interpretations of the results, and as
  641.   such, it is optional. It could be the most significant part of your report,
  642.   though, specially if you are doing comparative benchmarking.
  643.   ______________________________________________________________________
  644.  
  645.   3.7.  Network performance tests
  646.  
  647.   Testing network performance is a challenging task since it involves at
  648.   least two machines, a server and a client machine, hence twice the
  649.   time to setup and many more variables to control, etc... On an
  650.   ethernet network, I guess your best bet would be the ttcp package. (to
  651.   be expanded)
  652.  
  653.   3.8.  SMP tests
  654.  
  655.   SMP tests are another challenge, and any benchmark specifically
  656.   designed for SMP testing will have a hard time proving itself valid in
  657.   real-life settings, since algorithms that can take advantage of SMP
  658.   are hard to come by. It seems later versions of the Linux kernel (>
  659.   2.1.30 or around that) will do "fine-grained" multiprocessing, but I
  660.   have no more information than that for the moment.
  661.  
  662.   According to David Niemi, " ... shell8 part of the Unixbench 4.01
  663.   benchmaksdoes a good job at comparing similar hardware/OS in SMP and
  664.   UP modes."
  665.  
  666.   4.  Example run and results
  667.  
  668.   The LBT was run on my home machine, a Pentium-class Linux box that I
  669.   put together myself and that I used to write this HOWTO. Here is the
  670.   LBT Report Form for this system:
  671.  
  672.   LINUX BENCHMARKING TOOLKIT REPORT FORM
  673.  
  674.   CPU
  675.  
  676.   ==
  677.  
  678.   Vendor: Cyrix/IBM
  679.  
  680.   Model: 6x86L P166+
  681.  
  682.   Core clock: 133 MHz
  683.  
  684.   Motherboard vendor: Elite Computer Systems (ECS)
  685.  
  686.   Mbd. model: P5VX-Be
  687.  
  688.   Mbd. chipset: Intel VX
  689.  
  690.   Bus type: PCI
  691.  
  692.   Bus clock: 33 MHz
  693.  
  694.   Cache total: 256 KB
  695.  
  696.   Cache type/speed: Pipeline burst 6 ns
  697.  
  698.   SMP (number of processors): 1
  699.  
  700.   RAM
  701.  
  702.   ====
  703.  
  704.   Total: 32 MB
  705.  
  706.   Type: EDO SIMMs
  707.  
  708.   Speed: 60 ns
  709.  
  710.   Disk
  711.  
  712.   ====
  713.  
  714.   Vendor: IBM
  715.  
  716.   Model: IBM-DAQA-33240
  717.  
  718.   Size: 3.2 GB
  719.  
  720.   Interface: EIDE
  721.  
  722.   Driver/Settings: Bus Master DMA mode 2
  723.  
  724.   Video board
  725.  
  726.   ===========
  727.  
  728.   Vendor: Generic S3
  729.  
  730.   Model: Trio64-V2
  731.  
  732.   Bus: PCI
  733.  
  734.   Video RAM type: EDO DRAM
  735.  
  736.   Video RAM total: 2 MB
  737.  
  738.   X server vendor: XFree86
  739.  
  740.   X server version: 3.3
  741.  
  742.   X server chipset choice: S3 accelerated
  743.  
  744.   Resolution/vert. refresh rate: 1152x864 @ 70 Hz
  745.  
  746.   Color depth: 16 bits
  747.  
  748.   Kernel
  749.  
  750.   =====
  751.  
  752.   Version: 2.0.29
  753.  
  754.   Swap size: 64 MB
  755.  
  756.   gcc
  757.  
  758.   ===
  759.  
  760.   Version: 2.7.2.1
  761.  
  762.   Options: -O2
  763.  
  764.   libc version: 5.4.23
  765.  
  766.   Test notes
  767.  
  768.   ==========
  769.  
  770.   Very light load. The above tests were run with some of the special
  771.   Cyrix/IBM 6x86 features enabled with the setx86 program: fast ADS,
  772.   fast IORT, Enable DTE, fast LOOP, fast Lin. VidMem.
  773.  
  774.   RESULTS
  775.  
  776.   ========
  777.  
  778.   Linux kernel 2.0.0 Compilation Time: 7m12s
  779.  
  780.   Whetstones: 38.169 MWIPS.
  781.  
  782.   Xbench: 97243 xStones.
  783.  
  784.   BYTE Unix Benchmarks 4.01 system INDEX: 58.43
  785.  
  786.   BYTEmark integer INDEX: 1.50
  787.  
  788.   BYTEmark memory INDEX: 2.50
  789.  
  790.   Comments
  791.  
  792.   =========
  793.  
  794.   This is a very stable system with homogeneous performance, ideal
  795.   for home use and/or Linux development. I will report results
  796.   with a 6x86MX processor as soon as I can get my hands on one!
  797.  
  798.   5.  Pitfalls and caveats of benchmarking
  799.  
  800.   After putting together this HOWTO I began to understand why the words
  801.   "pitfalls" and "caveats" are so often associated with benchmarking...
  802.  
  803.   5.1.  Comparing apples and oranges
  804.  
  805.   Or should I say Apples and PCs ? This is so obvious and such an old
  806.   dispute that I won't go into any details. I doubt the time it takes to
  807.   load Word on a Mac compared to an average Pentium is a real measure of
  808.   anything. Likewise booting Linux and Windows NT, etc... Try as much as
  809.   possible to compare identical machines with a single modification.
  810.   5.2.  Incomplete information
  811.  
  812.   A single example will illustrate this very common mistake. One often
  813.   reads in comp.os.linux.hardware the following or similar statement: "I
  814.   just plugged in processor XYZ running at nnn MHz and now compiling the
  815.   linux kernel only takes i minutes" (adjust XYZ, nnn and i as
  816.   required). This is irritating, because no other information is given,
  817.   i.e. we don't even know the amount of RAM, size of swap, other tasks
  818.   running simultaneously, kernel version, modules selected, hard disk
  819.   type, gcc version, etc... I recommend you use the LBT Report Form,
  820.   which at least provides a standard information framework.
  821.  
  822.   5.3.  Proprietary hardware/software
  823.  
  824.   A well-known processor manufacturer once published results of
  825.   benchmarks produced by a special, customized version of gcc. Ethical
  826.   considerations apart, those results were meaningless, since 100% of
  827.   the Linux community would go on using the standard version of gcc. The
  828.   same goes for proprietary hardware. Benchmarking is much more useful
  829.   when it deals with off-the-shelf hardware and free (in the GNU/GPL
  830.   sense) software.
  831.  
  832.   5.4.  Relevance
  833.  
  834.   We are talking Linux, right ? So we should forget about benchmarks
  835.   produced on other operating systems (this is a special case of the
  836.   "Comparing apples and oranges" pitfall above). Also, if one is going
  837.   to benchmark Web server performance, do not quote FPU performance and
  838.   other irrelevant information. In such cases, less is more. Also, you
  839.   do not need to mention the age of your cat, your mood while
  840.   benchmarking, etc..
  841.  
  842.   6.  FAQ
  843.  
  844.      Q1.
  845.         Is there any single figure of merit for Linux systems ?
  846.  
  847.      A: No, thankfully nobody has yet come up with a Lhinuxstone (tm)
  848.         measurement. And if there was one, it would not make much sense:
  849.         Linux systems are used for many different tasks, from heavily
  850.         loaded Web servers to graphics workstations for individual use.
  851.         No single figure of merit can describe the performance of a
  852.         Linux system under such different situations.
  853.  
  854.      Q2.
  855.         Then, how about a dozen figures summarizing the performance of
  856.         diverse Linux systems ?
  857.  
  858.      A: That would be the ideal situation. I would like to see that come
  859.         true. Anybody volunteers for a Linux Benchmarking Project ? With
  860.         a Web site and an on-line, complete, well-designed reports
  861.         database ?
  862.  
  863.      Q3.
  864.  
  865.      A: BogoMips has nothing to do with the performance of your system.
  866.         Check the BogoMips Mini-HOWTO.
  867.  
  868.      Q4.
  869.         What is the "best" benchmark for Linux ?
  870.  
  871.      A: It all depends on which performance aspect of a Linux system one
  872.         wants to measure. There are different benchmarks to measure the
  873.         network (Ethernet sustained transfer rates), file server (NFS),
  874.         disk I/O, FPU, integer, graphics, 3D, processor-memory
  875.         bandwidth, CAD performance, transaction time, SQL performance,
  876.         Web server performance, real-time performance, CD-ROM
  877.         performance, Quake performance (!), etc ... AFAIK no bechmark
  878.         suite exists for Linux that supports all these tests.
  879.  
  880.      Q5.
  881.         What is the fastest processor under Linux ?
  882.  
  883.      A: Fastest at what task ? If one is heavily number-crunching
  884.         oriented, a very high clock rate Alpha (600 MHz and going)
  885.         should be faster than anything else, since Alphas have been
  886.         designed for that kind of performance. If, on the other hand,
  887.         one wants to put together a very fast news server, it is
  888.         probable that the choice of a fast hard disk subsystem and lots
  889.         of RAM will result in higher performance improvements than a
  890.         change of processor, for the same amount of $.
  891.  
  892.      Q6.
  893.         Let me rephrase the last question, then: is there a processor
  894.         that is fastest for general purpose applications ?
  895.  
  896.      A: This is a tricky question but it takes a very simple answer: NO.
  897.         One can always design a faster system even for general purpose
  898.         applications, independent of the processor. Usually, all other
  899.         things being equal, higher clock rates will result in higher
  900.         performance systems (and more headaches too). Taking out an old
  901.         100 MHz Pentium from an (usually not) upgradable motherboard,
  902.         and plugging in the 200 MHz version, one should feel the extra
  903.         "hummph". Of course, with only 16 MBytes of RAM, the same
  904.         investment would have been more wisely spent on extra SIMMs...
  905.  
  906.      Q7.
  907.         So clock rates influence the performance of a system ?
  908.  
  909.      A: For most tasks except for NOP empty loops (BTW these get removed
  910.         by modern optimizing compilers), an increase in clock rate will
  911.         not give you a linear increase in performance. Very small
  912.         processor intensive programs that will fit entirely in the
  913.         primary cache inside the processor (the L1 cache, usually 8 or
  914.         16 K) will have a performance increase equivalent to the clock
  915.         rate increase, but most "true" programs are much larger than
  916.         that, have loops that do not fit in the L1 cache, share the L2
  917.         (external) cache with other processes, depend on external
  918.         components and will give much smaller performance increases.
  919.         This is because the L1 cache runs at the same clock rate as the
  920.         processor, whereas most L2 caches and all other subsystems
  921.         (DRAM, for example) will run asynchronously at lower clock
  922.         rates.
  923.  
  924.      Q8.
  925.         OK, then, one last question on that matter: which is the
  926.         processor with the best price/performance ratio for general
  927.         purpose Linux use ?
  928.  
  929.      A: Defining "general purpose Linux use" in not an easy thing ! For
  930.         any particular application, there is always a processor with THE
  931.         BEST price/performance ratio at any given time, but it changes
  932.         rather frequently as manufacturers release new processors, so
  933.         answering Processor XYZ running at n MHz would be a snapshot
  934.         answer. However, the price of the processor is insignificant
  935.         when compared to the price of the whole system one will be
  936.         putting together. So, really, the question should be how can one
  937.         maximize the price/performance ratio for a given system ? And
  938.         the answer to that question depends heavily on the minimum
  939.         performance requirements and/or maximum cost established for the
  940.         configuration being considered. Sometimes, off-the-shelf
  941.         hardware will not meet minimum performance requirements and
  942.         expensive RISC systems will be the only alternative. For home
  943.         use, I recommend a balanced, homogeneous system for overall
  944.         performance (now go figure what I mean by balanced and
  945.         homogeneous :-); the choice of a processor is an important
  946.         decision , but no more than choosing hard disk type and
  947.         capacity, amount of RAM, video card, etc...
  948.  
  949.      Q9.
  950.         What is a "significant" increase in performance ?
  951.  
  952.      A: I would say that anything under 1% is not significant (could be
  953.         described as "marginal"). We, humans, will hardly perceive the
  954.         difference between two systems with a 5 % difference in response
  955.         time. Of course some hard-core benchmarkers are not humans and
  956.         will tell you that, when comparing systems with 65.9 and 66.5
  957.         performance indexes, the later is "definitely faster".
  958.  
  959.      Q10.
  960.         How do I obtain "significant" increases in performance at the
  961.         lowest cost ?
  962.  
  963.      A: Since most source code is available for Linux, careful
  964.         examination and algorithmic redesign of key subroutines could
  965.         yield order-of-magnitude increases in performance in some cases.
  966.         If one is dealing with a commercial project and does not wish to
  967.         delve deeply in C source code a Linux consultant should be
  968.         called in. See the Consultants-HOWTO.
  969.  
  970.   7.  Copyright, acknowledgments and miscellaneous
  971.  
  972.   7.1.  How this document was produced
  973.  
  974.   The first step was reading section 4 "Writing and submitting a HOWTO"
  975.   of the HOWTO Index by Greg Hankins.
  976.  
  977.   I knew absolutely nothing about SGML or LaTeX, but was tempted to use
  978.   an automated documentation generation package after reading the
  979.   various comments about SGML-Tools. However, inserting tags manually in
  980.   a document reminds me of the days I hand-assembled a 512 byte monitor
  981.   program for a now defunct 8-bit microprocessor, so I got hold of the
  982.   LyX sources, compiled it, and used its LinuxDoc mode. Highly
  983.   recommended combination: LyX and SGML-Tools.
  984.  
  985.   7.2.  Copyright
  986.  
  987.   The Linux Benchmarking HOWTO is copyright (C) 1997 by AndrΘ D. Balsa.
  988.   Linux HOWTO documents may be reproduced and distributed in whole or in
  989.   part, in any medium physical or electronic, as long as this copyright
  990.   notice is retained on all copies. Commercial redistribution is allowed
  991.   and encouraged; however, the author would like to be notified of any
  992.   such distributions.
  993.  
  994.   All translations, derivative works, or aggregate works incorporating
  995.   any Linux HOWTO documents must be covered under this copyright notice.
  996.   That is, you may not produce a derivative work from a HOWTO and impose
  997.   additional restrictions on its distribution. Exceptions to these rules
  998.   may be granted under certain conditions; please contact the Linux
  999.   HOWTO coordinator at the address given below.
  1000.  
  1001.   In short, we wish to promote dissemination of this information through
  1002.   as many channels as possible. However, we do wish to retain copyright
  1003.   on the HOWTO documents, and would like to be notified of any plans to
  1004.   redistribute the HOWTOs.
  1005.  
  1006.   If you have questions, please contact Greg Hankins, the Linux HOWTO
  1007.   coordinator, at gregh@sunsite.unc.edu via email, or at +1 404 853
  1008.   9989.
  1009.  
  1010.   7.3.  New versions of this document
  1011.  
  1012.   New versions of the Linux Benchmarking-HOWTO will be placed on
  1013.   sunsite.unc.edu and mirror sites. There are other formats, such as a
  1014.   Postscript and dvi version in the other-formats directory. The Linux
  1015.   Benchmarking-HOWTO is also available for WWW clients such as Grail, a
  1016.   Web browser written in Python. It will also be posted regularly to
  1017.   comp.os.linux.answers.
  1018.  
  1019.   7.4.  Feedback
  1020.  
  1021.   Suggestions, corrections, additions wanted. Contributors wanted and
  1022.   acknowledged. Flames not wanted.
  1023.  
  1024.   I can always be reached at andrewbalsa@usa.net.
  1025.  
  1026.   7.5.  Acknowledgments
  1027.  
  1028.   David Niemi, the author of the Unixbench suite, has proved to be an
  1029.   endless source of information and (valid) criticism.
  1030.  
  1031.   I also want to thank Greg Hankins, the Linux HOWTO coordinator and one
  1032.   of the main contributors to the SGML-tools package, Linus Torvalds and
  1033.   the entire Linux community. This HOWTO is my way of giving back.
  1034.  
  1035.   7.6.  Disclaimer
  1036.  
  1037.   Your mileage may, and will, vary. Be aware that benchmarking is a
  1038.   touchy subject and a great time-and-energy consuming activity.
  1039.  
  1040.   7.7.  Trademarks
  1041.  
  1042.   Pentium and Windows NT are trademarks of Intel and Microsoft
  1043.   Corporations respectively.
  1044.  
  1045.   BYTE and BYTEmark are trademarks of McGraw-Hill, Inc.
  1046.  
  1047.   Cyrix and 6x86 are trademarks of Cyrix Corporation.
  1048.  
  1049.   Linux is not a trademark, hopefully never will be.
  1050.  
  1051.